import React from 'react'
import './AddGoods.css'
import {Row, Col, Button, Modal} from 'antd';
import axios from "axios";
const { confirm } = Modal;

class AddGoods extends React.Component {
    submit = () => {
        confirm({
            content: '是否新增商品',
            onOk() {
                axios({
                    url: '',
                    method: 'post',
                }).then(res => {
                    console.log(res);
                })
            },
        });
    }
    render() {
        return (
            <div>
                <div className="topInput">
                    <Row className="myTitle">
                        <Col span={24} ><span className="title">商品基本信息</span></Col>
                    </Row>
                    <div className="line"/>
                    <Row style={{marginTop:'10px'}}>
                        <Col span={12}>商品编号： <input className="myInput" placeholder={'请填写商品id，不可重复'}/></Col>
                        <Col span={12}>商品名称：<input className="myInput" placeholder={'请填写商品名称，最多20字'} /></Col>
                    </Row>
                    <Row style={{marginTop:'10px'}}>
                        <Col span={12}>商品类型： <input className="myInput" placeholder={'请填写商品类型'}/></Col>
                        <Col span={12}>商品库存：<input className="myInput" placeholder={'请填写商品库存'}/></Col>
                    </Row>
                    <Row style={{marginTop:'10px'}}>
                        <Col span={12}>购买限制： <input className="myInput" placeholder={'请填写单人购买数量，不超过库存'}/></Col>
                        <Col span={12}>商品描述：<textarea className="myInput" placeholder={'请填写商品描述，最多50字'} /></Col>
                    </Row>
                </div>
                <div className="topInput">
                    <Row className="myTitle">
                        <Col span={24} ><span className="title">商品图片</span></Col>
                    </Row>
                    <div className="line"/>
                    <Row style={{marginTop:'10px'}}>
                        <Col span={12}>首页大图</Col>
                        <Col span={12}>详情大图</Col>
                    </Row>
                    <Row style={{marginTop:'10px'}}>
                        <Col span={12}>
                            <div className="preview"/>
                            <input type="file" accept="image/*" onChange="uploadImg(event,this)" id="imgSrc1"/>
                        </Col>
                        <Col span={12}> <div className="preview"/>
                            <input type="file" accept="image/*" onChange="uploadImg(event,this)" id="imgSrc1"/></Col>
                    </Row>
                </div>
                <div className="footer">
                    <Row className="myTitle">
                        <Col span={24} ><span className="title">商品规格</span></Col>
                    </Row>
                    <div className="line"/>
                    <div className="footer_title">
                        <Row>
                            <Col span={6}>原价（元）</Col>
                            <Col span={6}>促销价（元）</Col>
                            <Col span={6}>成本价（元）</Col>
                            <Col span={6}>供货商</Col>
                        </Row>
                    </div>
                    <div className="footer_title">
                        <Row>
                            <Col span={6}><input type="text"/></Col>
                            <Col span={6}><input type="text"/></Col>
                            <Col span={6}><input type="text"/></Col>
                            <Col span={6}><input type="text"/></Col>
                        </Row>
                    </div>

                </div>
                <div className="footer_btn">
                    <Row>
                        <Col span={8}/>
                        <Col span={8}>
                            <Button onClick={this.submit.bind(this, this.props.rowData)} size="middle" type="primary" >提交</Button></Col>
                        <Col span={8}/>
                    </Row>
                </div>
            </div>
        )
    }
}

export default AddGoods